<!DOCTYPE html >
<html>
<head>
<meta charset=UTF-8>
<title>Insert title here</title>
<script>
var result=document.getElementById("result");
var input=document.getElementById("input");
function readFile()
{
	var file=document.getElementById("file").files[0];
	 var reader=new FileReader();
	 reader.onload=function (e)
	 {
		 var result=document.getElementById("result");
		 result.innerHTML="<img src='"+this.result+"' alt=''/>";		 
		 alert("onload");
	 };
	 reader.onprogress=function (e)
	 {		 		 
		 alert("onprogress");
	 };
	 reader.onabort=function (e)
	 {		 		 
		 alert("onabort");
	 };
	 reader.onerror=function (e)
	 {		 		 
		 alert("onerror");
	 };
	 reader.onloadstart=function (e)
	 {		 		 
		 alert("onloadstart");
	 };
	 reader.onloadend=function (e)
	 {		 		 
		 alert("onloadend");
	 };
	 reader.readAsDataURL(file);
}
</script>
</head>
<body>
<input type="file" id="file" onchange="readFile()"/>
<div id="result"></div>
</body>
</html>